<template>
  <div class="collectidtwo">
    <div id="shoucang0" class="fa fa-user fa-lg">收藏分享圈信息</div>
    <div id="textbody">
      <div v-for="(val,key) in upmenuinf" id="textimg">
        <img :src="getcollectpic(upmenuinf[key].finishPic)" alt />
        <router-link
          :to="'/index/sharedetail/' + upmenuinf[key].upmenuId"
          id="texttext"
        >{{upmenuinf[key].upmenuTitle}}</router-link>
        <div id='textlike'>点赞数：{{upmenuinf[key].likeNum}}</div>
        <div id='texttime'>{{renderTime(upmenuinf[key].upTime)}}</div>
        
      </div>
      <hr>
      <p id="textbottom">暂无别的收藏，已最底部！！！</p>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      upmenuinf: [],
    };
  },
  created() {
    this.$axios
      .get("http://localhost:3000/chat/collect2")
      .then(res => {
        this.upmenuinf = res.data.data;
        console.log(res.data.data)
      })
      .catch(err => {
        console.log("错误信息：", err);
      });
  },
  methods: {
      //时间转码
    renderTime(date) {
      var dateee = new Date(date).toJSON();
      return new Date(+new Date(dateee) + 8 * 3600 * 1000)
        .toISOString()
        .replace(/T/g, " ")
        .replace(/\.[\d]{3}Z/, "");
    },
    getcollectpic(collectpic) {
      return require("../../../../Eatproj/EAT/public/upload/" + collectpic);
    }
  }
};
</script>
<style lang="css" scoped>
.collectidtwo {
  width: 60%;
  height: 100%;
}

#shoucang0 {
  margin-top:10px;
  width: 900px;
  height: 50px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(45deg, rgb(160, 191, 124), rgb(255, 255, 255))
    fixed;
  line-height: 50px;
  font-size: 22px;
  padding-left: 40px;
}
#textbody {
  width: 900px;
  border: 1px solid #ccc;
  float: left;
}

#textimg {
  margin-left: 60px;
  margin-top: 30px;
  width: 200px;
  height: 265px;
  float: left;
  /* border:1px solid red; */
}
#textimg img:hover{
  width: 200px;
  height: 200px;
  border:1px solid #ccc;
  box-shadow: 2px 2px 5px #ccc;
}
#textbody img {
  width: 200px;
  height: 200px;
  float: left;
  border-radius: 5px;
  position: relative;
}
/* #textimg:hover #textbackground{
  display: block;
} 
#textbackground{
  display: none;
  width: 200px;
  height: 200px;
  float: left;
  background-color: rgba(210,210,210);
  border-radius: 5px;
  position: absolute;
} */
#texttext {
  float: left;
  width: 200px;
  height: 25px;
  line-height: 25px;
  text-align: center;
  /* border: 1px solid black; */
  /* padding-left: 40px; */
  /* padding-top:30px; */
}
#texttime{
    float: left;
    text-align: center;
  width: 200px;
  height: 20px;
  /* border:1px solid green; */
}
#textlike{
    float: left;
    text-align: center;
  width: 200px;
  height: 20px;
  /* border:1px solid blue; */
}
#textdel {
  margin-left: 60px;
  margin-top: 30px;
  height: 250px;
  /* border: 1px solid red; */
}
#textdel button {
  width: 80px;
  height: 40px;
  border: 1px solid rgb(255, 255, 255);
  border-radius: 5px;
  background-color: rgb(160, 191, 124);
  color: white;
  margin-top:160px;
  margin-left: 10px;
}

#textbottom {
  width: 900px;
  float: left;
  text-align: center;
}
</style>